package com.xxx.coll;

import java.util.Comparator;

/**
 * @version v1.0
 * @Description
 * @Author admin
 * @date 2021/7/21  10:23
 * @Copyright
 */

//比较器类
public class ComparatiirImpl implements Comparator {
    @Override
    public int compare(Object o1, Object o2) {
        worker worker1 =(worker) o1;
        worker worker2 =(worker) o2;
        return worker1.getAge() - worker2.getAge();
    }
}
